package a_o2odata_deal

import a_aa_amainpackage.a_o2odata_deal.config.config.source_result
import org.apache.spark.sql.SparkSession

/**
  * @ Auther: o2o-rd-0008
  * @ Date:   2019/12/3 10:38
  * @ Param:  ${PARAM}
  * @ Description: 
  */
object checkData_main {

  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder()
      //      .master("local[*]")
      .appName("brand_join_res")
      .config("spark.hadoop.fs.s3a.access.key", "GAO7EO9FWKPJ8WFCQDME")
      .config("spark.hadoop.fs.s3a.secret.key", "LZ0xaHBSYKHaJ9ECDbX9f7zin79UZkXfGoNapRPL")
      //      .config("spark.hadoop.fs.s3a.endpoint", "https://obs.cn-north-1.myhuaweicloud.com")
      .getOrCreate()

    val brand_data = spark.read.orc(s"${source_result}")
      .where("cast(sellCount as bigint)>0 and cast(salesAmount as double)>0 and cast(priceText as double)>0")
      .dropDuplicates("good_id")

    a_aa_amainpackage.a_o2odata_deal.utils.CheckData.checkData(spark,brand_data)
  }

}
